"ModuleText": "Attribute VB_Name = \"Utility Functions\"\r\nOption Compare Database\r\nOption Explicit\r\n\r\n\r\n\r\n\r\n\r\n\r\nFunction IsLoaded(ByVal strFormName As String) As Integer\r\n ' Returns True if the specified form is open in Form view or Datasheet view.\r\n \r\n Const conObjStateClosed = 0\r\n Const conDesignView = 0\r\n \r\n If SysCmd(acSysCmdGetObjectState, acForm, strFormName) <> conObjStateClosed Then\r\n If Forms(strFormName).CurrentView <> conDesignView Then\r\n IsLoaded = True\r\n End If\r\n End If\r\n \r\nEnd Function\r\n\r\n"
"ModuleText": "Attribute VB_Name = \"Form_Customer Orders Subform1\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\nSub Form_Current()\r\n' This code created by Form Wizard.\r\n Dim ParentDocName As String\r\n\r\n On Error Resume Next\r\n ParentDocName = Me.Parent.Name\r\n\r\n If Err <> 0 Then\r\n GoTo Form_Current_Exit\r\n Else\r\n On Error GoTo Form_Current_Err\r\n Me.Parent![Customer Orders Subform2].Requery\r\n End If\r\n\r\nForm_Current_Exit:\r\n Exit Sub\r\n\r\nForm_Current_Err:\r\n MsgBox Err.Description\r\n Resume Form_Current_Exit\r\n\r\nEnd Sub\r\n\r\n"
"ModuleText": "Attribute VB_Name = \"Form_Employees\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\n\r\n\r\n\r\nPrivate Sub CompanyInfo_Click()\r\n' This code similar to code created by Command Button Wizard.\r\nOn Error GoTo Err_CompanyInfo_Click\r\n\r\n ' Go to first page of form.\r\n Me.GoToPage 1\r\n\r\nExit_CompanyInfo_Click:\r\n Exit Sub\r\n\r\nErr_CompanyInfo_Click:\r\n MsgBox Err.Description\r\n Resume Exit_CompanyInfo_Click\r\n \r\nEnd Sub\r\n\r\nPrivate Sub PersonalInfo_Click()\r\n' This code similar to code created by Command Button Wizard.\r\nOn Error GoTo Err_PersonalInfo_Click\r\n\r\n ' Go to second page of form.\r\n Me.GoToPage 2\r\n\r\nExit_PersonalInfo_Click:\r\n Exit Sub\r\n\r\nErr_PersonalInfo_Click:\r\n MsgBox Err.Description\r\n Resume Exit_PersonalInfo_Click\r\n \r\nEnd Sub\r\n\r\n\r\n\r\n\r\n"
},
{
"ID": 10,
"DocType": 2,
"DocName": "Main Switchboard",
"ModuleText": "Attribute VB_Name = \"Form_Main Switchboard\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\nFunction OpenForms(strFormName As String) As Integer\r\n' This function is used in the Click event of command buttons that\r\n' open forms on the Main Switchboard. Using a function is more efficient\r\n' than repeating the same code in multiple event procedures.\r\nOn Error GoTo Err_OpenForms\r\n\r\n ' Open specified form.\r\n DoCmd.OpenForm strFormName\r\n\r\nExit_OpenForms:\r\n Exit Function\r\n\r\nErr_OpenForms:\r\n MsgBox Err.Description\r\n Resume Exit_OpenForms\r\n\r\nEnd Function\r\n\r\nSub ExitMicrosoftAccess_Click()\r\n' This code created by Command Button Wizard.\r\nOn Error GoTo Err_ExitMicrosoftAccess_Click\r\n\r\n ' Exit Microsoft Access.\r\n DoCmd.Quit\r\n\r\nExit_ExitMicrosoftAccess_Click:\r\n Exit Sub\r\n\r\nErr_ExitMicrosoftAccess_Click:\r\n MsgBox Err.Description\r\n Resume Exit_ExitMicrosoftAccess_Click\r\n \r\nEnd Sub\r\nSub DisplayDatabaseWindow_Click()\r\n' This code created in part by Command Button Wizard.\r\nOn Error GoTo Err_DisplayDatabaseWindow_Click\r\n\r\n Dim strDocName As String\r\n \r\n strDocName = \"Categories\"\r\n\r\n ' Close Main Switchboard form.\r\n DoCmd.Close\r\n \r\n ' Give focus to Database window; select Categories table (first\r\n ' form in list).\r\n DoCmd.SelectObject acTable, strDocName, True\r\n\r\nExit_DisplayDatabaseWindow_Click:\r\n Exit Sub\r\n\r\nErr_DisplayDatabaseWindow_Click:\r\n MsgBox Err.Description\r\n Resume Exit_DisplayDatabaseWindow_Click\r\n \r\nEnd Sub\r\n\r\n\r\n\r\n\r\n\r\n"
},
{
"ID": 11,
"DocType": 2,
"DocName": "Orders",
"ModuleText": "Attribute VB_Name = \"Form_Orders\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\n\r\nPrivate Sub CustomerID_AfterUpdate()\r\n' Update ShipTo controls based on value selected in CustomerID combo box.\r\n Me!ShipName = Me![CustomerID].Column(1)\r\n Me!ShipAddress = Me!Address\r\n Me!ShipCity = Me!City\r\n Me!ShipRegion = Me!Region\r\n Me!ShipPostalCode = Me!PostalCode\r\n Me!ShipCountry = Me!Country\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub CustomerID_BeforeUpdate(Cancel As Integer)\r\n' Display message if CustomerID combo box is blank.\r\n\r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n \r\n If IsNull(Me!CustomerID) Or Me!CustomerID = \"\" Then\r\n strMsg = \"You must pick a value from the Bill To list.\"\r\n strTitle = \"Bill To Customer Required\"\r\n intStyle = vbOKOnly\r\n MsgBox strMsg, intStyle, strTitle\r\n Cancel = True\r\n End If\r\n\r\nEnd Sub\r\n\r\n\r\nSub PrintInvoice_Click()\r\n' This code created by Command Button Wizard.\r\nOn Error GoTo Err_PrintInvoice_Click\r\n\r\n Dim DocName As String\r\n \r\n DocName = \"Invoice\"\r\n ' Print Invoice report, using Invoices Filter query to print\r\n ' invoice for current order.\r\n DoCmd.OpenReport DocName, acNormal, \"Invoices Filter\"\r\n\r\nExit_PrintInvoice_Click:\r\n Exit Sub\r\n\r\nErr_PrintInvoice_Click:\r\n MsgBox Err.Description\r\n Resume Exit_PrintInvoice_Click\r\n \r\nEnd Sub\r\n"
},
{
"ID": 12,
"DocType": 2,
"DocName": "Orders Subform",
"ModuleText": "Attribute VB_Name = \"Form_Orders Subform\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\nPrivate Sub Form_BeforeUpdate(Cancel As Integer)\r\n' If Orders Subform is opened as a standalone form, display a message\r\n' and undo changes made to the ProductName text box. (The IsLoaded function\r\n' finds a form in the Forms collection when it's opened as a standalone\r\n' form, but not when it's opened as a subform on a main form.)\r\n\r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n\r\n If IsLoaded(\"Orders Subform\") Then\r\n strMsg = \"You can't add or edit a record when you open Orders Subform as a standalone form.\"\r\n intStyle = vbOKOnly\r\n strTitle = \"Can't Add or Change Record\"\r\n MsgBox strMsg, intStyle, strTitle\r\n Me.Undo\r\n End If\r\n\r\nEnd Sub\r\n\r\nPrivate Sub ProductID_AfterUpdate()\r\nOn Error GoTo Err_ProductID_AfterUpdate\r\n\r\n Dim strFilter As String\r\n \r\n ' Evaluate filter before it's passed to DLookup function.\r\n strFilter = \"ProductID = \" & Me!ProductID\r\n \r\n ' Look up product's unit price and assign it to UnitPrice control.\r\n Me!UnitPrice = DLookup(\"UnitPrice\", \"Products\", strFilter)\r\n\r\nExit_ProductID_AfterUpdate:\r\n Exit Sub\r\n\r\nErr_ProductID_AfterUpdate:\r\n MsgBox Err.Description\r\n Resume Exit_ProductID_AfterUpdate\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub ProductID_BeforeUpdate(Cancel As Integer)\r\n' If Orders Subform is opened as a standalone form, display a message\r\n' and undo changes made to the ProductName text box. (The IsLoaded function\r\n' finds a form in the Forms collection when it's opened as a standalone\r\n' form, but not when it's opened as a subform on a main form.)\r\n\r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n \r\n If IsLoaded(\"Orders Subform\") Then\r\n strMsg = \"You can't add or edit a Product Name when you open Orders Subform as a standalone form.\"\r\n intStyle = vbOKOnly\r\n strTitle = \"Can't Add or Change Product Name\"\r\n MsgBox strMsg, intStyle, strTitle\r\n Me!ProductID.Undo\r\n Me.Undo\r\n End If\r\n\r\nEnd Sub\r\n\r\n\r\n\r\n\r\n"
"ModuleText": "Attribute VB_Name = \"Form_Products\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\n\r\nPrivate Sub Form_BeforeUpdate(Cancel As Integer)\r\n' Display a message box that says that product name is required.\r\n \r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n \r\n If IsNull(Me![ProductName]) Then\r\n strMsg = \"You must enter a product name before you leave the record.\" ' Define message.\r\n intStyle = vbOKOnly + vbInformation ' Define buttons.\r\n strTitle = \"Product Name Required\" ' Define title.\r\n MsgBox strMsg, intStyle, strTitle\r\n DoCmd.CancelEvent\r\n End If\r\nEnd Sub\r\n\r\n\r\nPrivate Sub Form_Error(DataErr As Integer, Response As Integer)\r\n' Suppress Microsoft Access error message and display custom message\r\n' in BeforeUpdate event of form if user attempts to leave\r\n' record without entering a value in ProductName field.\r\n\r\n Const conValueRequired = 3314\r\n \r\n If DataErr = conValueRequired Then\r\n Response = acDataErrContinue\r\n End If\r\n \r\nEnd Sub\r\n\r\n\r\n"
"ModuleText": "Attribute VB_Name = \"Form_Sales by Year Dialog\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\nPrivate Sub Cancel_Click()\r\n' This code created by Command Button Wizard.\r\nOn Error GoTo Err_Cancel_Click\r\n\r\n ' Close form.\r\n DoCmd.Close\r\n\r\nExit_Cancel_Click:\r\n Exit Sub\r\n\r\nErr_Cancel_Click:\r\n MsgBox Err.Description\r\n Resume Exit_Cancel_Click\r\n\r\n\r\nEnd Sub\r\n\r\n\r\n\r\n\r\n\r\nPrivate Sub OK_Click()\r\nOn Error GoTo Err_OK_Click\r\n\r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n \r\n ' If Sales by Year report is not being opened for previewing or printing,\r\n ' cause an error. (fOpening variable is true only when report's Open event\r\n ' is being executed.)\r\n If Not Reports![Sales By Year].fOpening Then Err.Raise 0\r\n \r\n ' Hide form.\r\n Me.Visible = False\r\n\r\nExit_OK_Click:\r\n Exit Sub\r\n\r\nErr_OK_Click:\r\n strMsg = \"To use this form, you must preview or print the Sales by Year report from the Database window or Design view.\"\r\n intStyle = vbOKOnly\r\n strTitle = \"Open from Report\"\r\n\r\n MsgBox strMsg, intStyle, strTitle\r\n Resume Exit_OK_Click\r\n\r\nEnd Sub\r\n\r\n\r\n"
},
{
"ID": 19,
"DocType": 2,
"DocName": "Sales Reports Dialog",
"ModuleText": "Attribute VB_Name = \"Form_Sales Reports Dialog\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\n\r\nSub PrintReports(PrintMode As Integer)\r\nOn Error GoTo Err_Preview_Click\r\n ' This procedure used in Preview_Click and Print_Click Sub procedures.\r\n ' Preview or print report selected in the ReportToPrint option group.\r\n ' Then close the Print Sales Reports Dialog form.\r\n\r\n Dim strWhereCategory As String\r\n\r\n strWhereCategory = \"CategoryName = Forms![Sales Reports Dialog]!SelectCategory\"\r\n\r\n Select Case Me!ReportToPrint\r\n Case 1\r\n DoCmd.OpenReport \"Employee Sales by Country\", PrintMode\r\n Case 2\r\n DoCmd.OpenReport \"Sales Totals by Amount\", PrintMode\r\n Case 3\r\n If IsNull(Forms![Sales Reports Dialog]!SelectCategory) Then\r\n DoCmd.OpenReport \"Sales by Category\", PrintMode\r\n Else\r\n DoCmd.OpenReport \"Sales by Category\", PrintMode, , strWhereCategory\r\n End If\r\n End Select\r\n DoCmd.Close acForm, \"Sales Reports Dialog\"\r\n\r\nExit_Preview_Click:\r\n Exit Sub\r\n\r\nErr_Preview_Click:\r\n Resume Exit_Preview_Click\r\n\r\nEnd Sub\r\n\r\nPrivate Sub Cancel_Click()\r\n' This code created by Command Button Wizard.\r\nOn Error GoTo Err_Cancel_Click\r\n\r\n ' Close form.\r\n DoCmd.Close\r\n \r\nExit_Cancel_Click:\r\n Exit Sub\r\n \r\nErr_Cancel_Click:\r\n MsgBox Err.Description\r\n Resume Exit_Cancel_Click\r\n\r\nEnd Sub\r\n\r\nPrivate Sub Preview_Click()\r\n' Preview selected report. This procedure uses the PrintReports\r\n' Sub procedure defined in (General) section of this module.\r\n \r\n PrintReports acPreview\r\n\r\nEnd Sub\r\n\r\n\r\n\r\n\r\nPrivate Sub Print_Click()\r\n' Print selected report. This procedure uses the PrintReports\r\n' Sub procedure defined in (General) section of this module.\r\n\r\n PrintReports acNormal\r\n \r\nEnd Sub\r\n\r\n\r\n\r\nPrivate Sub ReportToPrint_AfterUpdate()\r\n' Enable SelectCategory combo box if user selected Sales by Category\r\n' report.\r\n\r\n Const conSalesByCategory = 3\r\n\r\n If Me!ReportToPrint.Value = conSalesByCategory Then\r\n Me!SelectCategory.Enabled = True\r\n Else\r\n Me!SelectCategory.Enabled = False\r\n End If\r\n \r\nEnd Sub\r\n\r\n\r\n"
},
{
"ID": 20,
"DocType": 2,
"DocName": "Startup",
"ModuleText": "Attribute VB_Name = \"Form_Startup\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\n\r\n\r\n\r\nPrivate Sub Form_Close()\r\n' If HideStartupForm check box is checked, don't show Startup\r\n' form again.\r\nOn Error GoTo Err_Form_Close\r\n\r\n If Me!HideStartupForm Then CurrentDb().Properties.Delete \"StartupForm\"\r\n\r\n\r\nExit_Form_Close:\r\n Exit Sub\r\n\r\nErr_Form_Close:\r\n ' If user checked HideStartupForm check box in a previous session with\r\n ' Startup form, just close form.\r\n Const conNotInCollection = 3265\r\n \r\n If Err = conNotInCollection Then\r\n Resume Exit_Form_Close\r\n End If\r\n \r\n ' For other errors, display just the description.\r\n \r\n MsgBox Err.Description\r\n Resume Exit_Form_Close\r\nEnd Sub\r\n\r\n\r\n\r\n\r\n\r\nPrivate Sub OK_Click()\r\n' This code created by Command Button Wizard.\r\nOn Error GoTo Err_OK_Click\r\n \r\n ' Close Startup form.\r\n DoCmd.Close\r\n \r\nExit_OK_Click:\r\n Exit Sub\r\n \r\nErr_OK_Click:\r\n MsgBox Err.Description\r\n Resume Exit_OK_Click\r\n\r\nEnd Sub\r\n\r\n\r\n\r\n\r\n"
},
{
"ID": 21,
"DocType": 2,
"DocName": "Suppliers",
"ModuleText": "Attribute VB_Name = \"Form_Suppliers\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\nPrivate Sub AddProducts_Click()\r\n' This code created in part by Command Button Wizard.\r\nOn Error GoTo Err_AddProducts_Click\r\n\r\n Dim strDocName As String\r\n\r\n strDocName = \"Products\"\r\n ' Open Products form in data entry mode.\r\n DoCmd.OpenForm strDocName, , , , acAdd\r\n \r\n ' Close Product List form.\r\n DoCmd.Close acForm, \"Product List\"\r\n\r\n ' Set SupplierID combo box on Products form to value in SupplierID\r\n ' combo box on Suppliers form.\r\n Forms![Products]!SupplierID = Me!SupplierID\r\n \r\n ' Give ProductName control focus.\r\n Forms![Products]!ProductName.SetFocus\r\n \r\nExit_AddProducts_Click:\r\n Exit Sub\r\n \r\nErr_AddProducts_Click:\r\n MsgBox Err.Description\r\n Resume Exit_AddProducts_Click\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub Form_BeforeUpdate(Cancel As Integer)\r\n\r\n' If number of digits entered in PostalCode text box is incorrect for value\r\n' in Country text box, display message and undo PostalCode value.\r\n\r\n Select Case Me!Country\r\n Case IsNull(Me![Country])\r\n Exit Sub\r\n Case \"France\", \"Italy\", \"Spain\"\r\n If Len(Me![PostalCode]) <> 5 Then\r\n MsgBox \"Postal Code must be 5 characters\", 0, \"Postal Code Error\"\r\n DoCmd.CancelEvent\r\n Me![PostalCode].SetFocus\r\n End If\r\n Case \"Australia\", \"Singapore\"\r\n If Len(Me![PostalCode]) <> 4 Then\r\n MsgBox \"Postal Code must be 4 characters\", 0, \"Postal Code Error\"\r\n DoCmd.CancelEvent\r\n Me![PostalCode].SetFocus\r\n End If\r\n Case \"Canada\"\r\n If Not Me![PostalCode] Like \"[A-Z][0-9][A-Z] [0-9][A-Z][0-9]\" Then\r\n MsgBox \"Postal Code not valid. Example of Canadian code: H1J 1C3\", 0, \"Postal Code Error\"\r\n DoCmd.CancelEvent\r\n Me![PostalCode].SetFocus\r\n End If\r\n \r\n End Select\r\n\r\n\r\nEnd Sub\r\n\r\nPrivate Sub Form_Close()\r\n\r\n ' Close Product List form and Products form if they are open.\r\n If IsLoaded(\"Product List\") Then DoCmd.Close acForm, \"Product List\"\r\n If IsLoaded(\"Products\") Then DoCmd.Close acForm, \"Products\"\r\n \r\nEnd Sub\r\n\r\nPrivate Sub Form_Current()\r\nOn Error GoTo Err_Form_Current\r\n\r\n' If Product List form is open, show current supplier's products.\r\n\r\n Dim strDocName As String\r\n Dim strLinkCriteria As String\r\n\r\n strDocName = \"Product List\"\r\n strLinkCriteria = \"[SupplierID] = Forms![Suppliers]![SupplierID]\"\r\n \r\n If IsNull(Me![CompanyName]) Then\r\n Exit Sub\r\n ElseIf IsLoaded(\"Product List\") Then\r\n DoCmd.OpenForm strDocName, , , strLinkCriteria\r\n End If\r\n\r\nExit_Form_Current:\r\n Exit Sub\r\n \r\nErr_Form_Current:\r\n MsgBox Err.Description\r\n Resume Exit_Form_Current\r\n\r\nEnd Sub\r\n\r\n\r\n\r\nPrivate Sub ReviewProducts_Click()\r\n' This code created in part by Command Button Wizard.\r\nOn Error GoTo Err_ReviewProducts_Click\r\n\r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n Dim strDocName As String, strLinkCriteria As String\r\n\r\n ' If CompanyName control is blank, display a message.\r\n If IsNull(Me![CompanyName]) Then\r\n strMsg = \"Move to the supplier record whose products you want to see, then press the Review Products button again.\"\r\n intStyle = vbOKOnly\r\n strTitle = \"Select a Supplier\"\r\n MsgBox strMsg, intStyle, strTitle\r\n Me![CompanyName].SetFocus\r\n Else\r\n ' Otherwise, open Product List form, showing products for current supplier.\r\n strDocName = \"Product List\"\r\n strLinkCriteria = \"[SupplierID] = Forms![Suppliers]![SupplierID]\"\r\n DoCmd.OpenForm strDocName, , , strLinkCriteria\r\n DoCmd.MoveSize (1440 * 0.78), (1440 * 1.8)\r\n End If\r\n \r\nExit_ReviewProducts_Click:\r\n Exit Sub\r\n \r\nErr_ReviewProducts_Click:\r\n MsgBox Err.Description\r\n Resume Exit_ReviewProducts_Click\r\n \r\nEnd Sub\r\n\r\n\r\n\r\n"
},
{
"ID": 22,
"DocType": 3,
"DocName": "Alphabetical List of Products",
"ModuleText": "Attribute VB_Name = \"Report_Alphabetical List of Products\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database\r\n\r\n\r\n"
"ModuleText": "Attribute VB_Name = \"Report_Employee Sales by Country\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\nPrivate Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)\r\n' Set page number to 1 when a new group starts.\r\n\r\n Page = 1\r\n \r\nEnd Sub\r\n\r\n\r\nPrivate Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)\r\n' Display ExceededGoalLabel and SalespersonLine if salesperson's total\r\n' meets criteria.\r\n\r\n If Me!SalespersonTotal > 5000 Then\r\n Me!ExceededGoalLabel.Visible = True\r\n Me!SalespersonLine.Visible = True\r\n Else\r\n Me!ExceededGoalLabel.Visible = False\r\n Me!SalespersonLine.Visible = False\r\n End If\r\n\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub Report_NoData(Cancel As Integer)\r\n' Display a message if user enters a date for which there are no records,\r\n' and don't preview or print report.\r\n\r\n Dim strMsg As String, strTitle As String\r\n Dim intStyle As Integer\r\n \r\n strMsg = \"You must enter a date between 1-Jul-93 and 3-May-95.\"\r\n intStyle = vbOKOnly\r\n strTitle = \"No Data for Date Range\"\r\n \r\n MsgBox strMsg, intStyle, strTitle\r\n Cancel = True\r\n\r\nEnd Sub\r\n\r\n\r\n"
"ModuleText": "Attribute VB_Name = \"Report_Sales by Year\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database ' Use database order for string comparisons.\r\nOption Explicit ' Requires variables to be declared before they are used.\r\n\r\n' This variable set to True while the Report_Open event is executing.\r\nPublic fOpening As Boolean\r\nPrivate Sub Detail_Format(Cancel As Integer, FormatCount As Integer)\r\n' If ShowDetails check box on Sales by Year Dialog form is cleared,\r\n' don't print detail section.\r\n\r\n If Forms![Sales by Year Dialog]!ShowDetails = False Then Cancel = True\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)\r\n \r\n ' If ShowDetails check box on Sales by Year Dialog form is checked,\r\n ' set value of Show text box to False so that page header won't print\r\n ' on next page.\r\n If Forms![Sales by Year Dialog]!ShowDetails Then\r\n Me!Show.Value = False\r\n Else\r\n ' If ShowDetails check box on Sales by Year Dialog form is cleared,\r\n ' don't print group footer.\r\n Cancel = True\r\n End If\r\n \r\nEnd Sub\r\n\r\n\r\nPrivate Sub GroupFooter1_Retreat()\r\n' If ShowDetails check box on Sales by Year Dialog form is checked,\r\n' set value of Show text box to True so that page header will print on\r\n' next page.\r\n\r\n If Forms![Sales by Year Dialog]!ShowDetails Then Me!Show.Value = True\r\n \r\nEnd Sub\r\n\r\n\r\nPrivate Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)\r\n\r\n Const None = 0\r\n \r\n ' If ShowDetails check box on Sales by Year Dialog form is checked,\r\n ' set value of Show text box to True so that page header will print on\r\n ' next page.\r\n If Forms![Sales by Year Dialog]!ShowDetails Then\r\n Me!Show.Value = True\r\n Else\r\n ' If ShowDetails check box on Sales by Year Dialog form is cleared, set\r\n ' ForceNewPage property to None and hide all labels for detail records.\r\n Me.Section(acGroupLevel1Footer).ForceNewPage = None\r\n Me!Line10.Visible = False\r\n Me!Line15.Visible = False\r\n Me!DetailsLabel.Visible = False\r\n Me!LineNumberLabel2.Visible = False\r\n Me!ShippedDateLabel2.Visible = False\r\n Me!OrdersShippedLabel2.Visible = False\r\n Me!SalesLabel2.Visible = False\r\n End If\r\n \r\nEnd Sub\r\n\r\nPrivate Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)\r\n' If value of Show text box is False, don't print page header .\r\n\r\n If Me!Show.Value = False Then Cancel = True\r\n\r\nEnd Sub\r\n\r\n\r\nPrivate Sub Report_Close()\r\n' Close the Sales by Year Dialog form.\r\n\r\n Dim strDocName As String\r\n\r\n strDocName = \"Sales by Year Dialog\"\r\n\r\n DoCmd.Close acForm, strDocName\r\n\r\nEnd Sub\r\n\r\nPrivate Sub Report_Open(Cancel As Integer)\r\n' Open Sales by Year Dialog form.\r\n' IsLoaded function (defined in Utility Functions module) determines\r\n' if specified form is open.\r\n \r\n Dim strDocName As String\r\n\r\n strDocName = \"Sales by Year Dialog\"\r\n ' Set public variable to True so Sales by Year Dialog knows that report\r\n ' is in its Open event.\r\n fOpening = True\r\n \r\n ' Open form.\r\n DoCmd.OpenForm strDocName, , , , , acDialog\r\n \r\n ' If Sales by Year Dialog form isn't loaded, don't preview or print report.\r\n ' (User clicked Cancel button on form.)\r\n If IsLoaded(strDocName) = False Then Cancel = True\r\n \r\n 'Set public variable to False, signifying that Open event is finished.\r\n fOpening = False\r\nEnd Sub\r\n\r\n\r\nPrivate Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)\r\n' If ShowDetails check box is cleared, set Show text box to False.\r\n\r\n If Forms![Sales by Year Dialog]!ShowDetails = False Then Me!Show.Value = False\r\n \r\nEnd Sub\r\n\r\n\r\n"
},
{
"ID": 31,
"DocType": 3,
"DocName": "Sales by Year Subreport",
"ModuleText": "Attribute VB_Name = \"Report_Sales by Year Subreport\"\r\nAttribute VB_Creatable = True\r\nAttribute VB_Exposed = False\r\nOption Compare Database\r\n\r\n"